﻿//-------------
// <copyright file="AccountService.cs" company="Uncas">
//     Copyright (c) Ole Lynge Sørensen. All rights reserved.
// </copyright>
//-------------

namespace Uncas.Katas.SimpleMembership.Web.Controllers
{
    using System.Web.Security;

    /// <summary>
    /// Website account service.
    /// </summary>
    public class AccountService : IAccountService
    {
        /// <summary>
        /// Logs the user on.
        /// </summary>
        /// <param name="userName">Name of the user.</param>
        public void LogOn(string userName)
        {
            FormsAuthentication.SetAuthCookie(userName, true);
        }

        /// <summary>
        /// Logs the user off.
        /// </summary>
        public void LogOff()
        {
            FormsAuthentication.SignOut();
        }
    }
}